{include file='common/head'}
<body>
<div class="x-body">
    <!--<table class="layui-table" style="width: 97px">
        <thead>
        <tr>
            <td>用户信息:</td>

        </tr>
        </thead>
    </table>-->
    <form class="layui-form" action="">
    <table class="layui-table">
        <tr>
            <td>用户ID:</td>
            <td><?php echo $rs['uid']?></td>
            <td>手机号:</td>
            <td><?php echo $rs['phone']?></td>
            <td>姓名:</td>
            <td>{if $rs.uname==''}{$rs.nickname}{else/}{$rs.uname}{/if}</td>
            <td >用户状态:</td>
            <td><?php if($rs['uflg']==1){echo '正常';}else{echo '锁定';}?></td>
        </tr>
    </table>
    <table class="layui-table" style="width: 97px">
        <thead>
        <tr>
            <td>信息内容:</td>

        </tr>
        </thead>
    </table>
    <table class="layui-table">
        <tr>
            <td>信息ID:</td>
            <td><?php echo $rs['mid']?></td>
            <td>信息类型:</td>
            <td><?php if($rs['type']==1){echo '产品';}else{echo '文章';}?></td>
            <td>发布时间:</td>
            <td><?php echo $rs['createtime']?></td>
          	<td>类型:</td>
          	<td><?php echo $rs['choice']?></td>
            <td>群组:</td>
          	<td><?php echo $rs['group_name']?></td>
           <!-- <td >信息状态:</td>
            <td><?php if($rs['stoptime']<date("Y-m-d H:i:s"))
                {
                    echo '过期';
                }
                else
                {
                    if($rs['mflg']=='0')
                    {
                        echo '锁定';
                    }
                    else
                    {
                         echo '正常';
                    }
                }?></td> -->
        </tr>
        <table class="layui-table" lay-even=""  style="width: 97px">
        <tr>
            <td width="40px">图片:</td>
        </tr>
        </table>
    </table>
    <div style="padding-left: 120px;margin-top: -40px;">
            <td>
              {if $arr2=='kong'}
              <img src="/upload/message/no.jpg" width="200">
              {else/}
                {volist name="arr2" id="ar"}
                <img src="/upload/message/{$ar}" width="200">
                {/volist}</td>
      			{/if}
    </div>
    <table class="layui-table">
        <tr>
            <td>标题</td>
            <td><?php echo $rs['title']?></td>
        </tr>
        <tr>
            <td>详情</td>
            <td><?php echo $rs['content']?></td>
        </tr>

    </table>
    <!--<table lay-skin="nob">
    <tr>
        <td class="td-status">
            <span class="layui-btn layui-btn-normal <?php if($rs['faxian']==0){echo 'layui-btn-disabled';}?> layui-btn-mini">&lt;!&ndash;已推荐&ndash;&gt;<?php if($rs['faxian']==1){echo '已推荐';}else{echo '未推荐';}?></span></td>
        <td class="td-manage">
            <a onclick="member_stop(this,'{$rs.mid}')" href="javascript:;"  title="<?php if($rs['faxian']==1){echo '已推荐';}else{echo '未推荐';}?>">
            <i class="layui-icon">&#xe601;</i>
        </a></td>
    </table>-->
        <table class="layui-table" lay-skin="nob" style="width: 150px">
            <tr>
                <td>推荐</td>
                <td> <input type="checkbox" {if $rs['faxian'] ==1}  checked="" {/if} name="status[]" lay-skin="switch" lay-filter="switchTest" lay-text="开启|关闭"/ value="{$rs.mid}"></td>
            </tr>
            <tr>
                <td>锁定</td>
                <td> <input type="checkbox" <?php if ($rs['mflg'] ==0): ?>  checked="" <?php endif; ?> name="status[]" lay-skin="switch" lay-filter="switchSuodoing" lay-text="开启|关闭" value="{$rs.mid}"/></td>
            </tr>

        </table>
        <div class="layui-form-item">
            <label class="layui-form-label">

            </label>
           <!-- <input type="checkbox" name="zzz" lay-filter="switchTest" lay-skin="switch" lay-text="开启|关闭">-->

        </div>
    </tr>

    <table class="layui-table">
        <tr>
            <td>感兴趣的人</td>
            <td>
                <?php
			    $arr=implode(",",$res);
				echo $arr;
			?></td>
        </tr>
    </table>
    <table class="layui-table">
        <tr>
            <td>评论</td>

        </tr>
        <tr>
            <td colspan="2">
              {foreach $evalute as $k}
              	{if $k.pjid==''}{$k.pnickname}{else/}{$k.pjid}{/if}&nbsp;:&nbsp;{$k.txt}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$k.create_time}&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="checkbox" {if($k.sfig == 2)} checked=""{/if}  name="status[]" lay-skin="switch" lay-filter="pinglun" lay-text="锁定|关闭" value="{$k.evalute_id}"/><br/>
            	
                {if !empty($k['down'])}
                    {foreach $k['down'] as $v}
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{if $v.uname==''}{$v.unickname}{else/}{$v.uname}{/if}&nbsp;回复&nbsp;{if $v.sname==''}{$v.snickname}{else/}{$v.sname}{/if}&nbsp;:&nbsp;{$v.txt}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$v.create_time}&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="checkbox" {if($v.sfig == 2)} checked=""{/if}  name="status[]" lay-skin="switch" lay-filter="pinglun" lay-text="锁定|关闭" value="{$v.evalute_id}"/><br/>
                    {/foreach}
                {/if}
                {/foreach}
            </td>

        </tr>
    </table>
    </form>
</div>

<div class="x-body">

</div>
<script>
    layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;
        //执行一个laydate实例
        form.on('switch(switchSuodoing)', function(data){
            var id = data.value;
            //alert(111);
            $.ajax({
                url: "{:url('index/xinxi/suodingflg')}",
                type: "post",
                dataType: "JSON",
                data: {mid: id},
                success: function (res) {
                    if (res ==1) {
                        layer.msg('操作成功！');
                        //alert(11);
                        //location.reload();
                        return false;
                    } else {
                        layer.msg('操作失败！');
                        /*setTimeout(function () {
                            location.reload();
                        }, 1000);*/
                        return false;
                    }
                }
            });
        });


        form.on('switch(switchTest)', function(data){
            var id = data.value;
            //var faxian=data.value.slice(2,3);
            //alert(faxian);
            $.ajax({
                url: "{:url('index/xinxi/faxianflg')}",
                type: "post",
                dataType: "JSON",
                data: {mid: id},
                success: function (res) {
                    if (res ==1) {
                        layer.msg('操作成功！');
                        //alert(11);
                        //location.reload();
                        return false;
                    } else {
                        layer.msg('操作失败！');
                        /*setTimeout(function () {
                            location.reload();
                        }, 1000);*/
                        return false;
                    }
                }
            });
        });

        form.on('switch(pinglun)', function(data){
            var id = data.value;
            //var faxian=data.value.slice(2,3);
            //alert(faxian);
            $.ajax({
                url: "{:url('index/xinxi/pinglunflg')}",
                type: "post",
                dataType: "JSON",
                data: {sid: id},
                success: function (res) {
                    if (res ==1) {
                        layer.msg('操作成功！');
                        //alert(11);
                        //location.reload();
                        return false;
                    } else {
                        layer.msg('操作失败！');
                        /*setTimeout(function () {
                            location.reload();
                        }, 1000);*/
                        return false;
                    }
                }
            });
        });


    });

    /*用户-停用*/
    function member_stop(obj,id){
        layer.confirm('确认要修改吗？',function(index){
             if($(obj).attr('title')=='已推荐'){
                 //var mid=id;
                 //alert(mid);
                    //发异步把用户状态进行更改
                    $(obj).attr('title','未推荐')
                    $(obj).find('i').html('&#xe601;');

                    $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('未推荐');
                    layer.msg('已取消推荐!',{icon: 5,time:1000});

                }else{
                 var mid=id;
                 $.ajax({
                     type: "post",
                     async:false,
                     url: "{:url('index/xinxi/faxianflg')}",
                     data: {'id':mid},
                     dataType:'json',
                     success:function (res) {
                         //console.log(res)
                         if(res==1){
                             $(obj).attr('title','已推荐')
                             alert(22);
                             $(obj).find('i').html('&#xe62f;');

                             $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已推荐');
                             layer.msg('已推荐!',{icon: 1,time:1000});
                         };
                     }
                 });
                 //var mid=id;
                 //alert(mid);

                }
        });
    }


    /*用户-删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }



    function delAll (argument) {

        var data = tableCheck.getData();

        layer.confirm('确认要删除吗？'+data,function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }
</script>

</body>

</html>